﻿using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Restaurant.BusinessEntity;
using Restaurant.Repository.Mapping;

namespace Restaurant.Repository
{
   public class RestaurantContext:DbContext
    {
       public RestaurantContext()
        {
            Database.SetInitializer(new DropCreateDatabaseIfModelChanges<RestaurantContext>());
        }

      //  public DbSet<Alumno> Alumnos { get; set; }
       public DbSet<AperturaCaja> AperturaCajas { get; set; }
       public DbSet<Caja> Cajas { get; set; }
       public DbSet<Categoria> Categorias { get; set; }
       public DbSet<Cliente> Clientes { get; set; }
       public DbSet<DetallePedido> DetallePedidos { get; set; }
       public DbSet<Mesa> Mesas { get; set; }
       public DbSet<Pedido> Pedidos { get; set; }
       public DbSet<Plato> Platos { get; set; }
       public DbSet<TipoCambio> TipoCambios { get; set; }
       public DbSet<Trabajador> Trabajadors { get; set; }
       public DbSet<Turno> Turnos { get; set; }
       public DbSet<Venta> Ventas { get; set; }
     


        protected override void OnModelCreating(DbModelBuilder modelBuilder)
        {
          //  modelBuilder.Configurations.Add(new AlumnoMap());
            modelBuilder.Configurations.Add(new AperturaCajaMap());
            modelBuilder.Configurations.Add(new CajaMap());
            modelBuilder.Configurations.Add(new CategoriaMap());
             modelBuilder.Configurations.Add(new ClienteMap());
             modelBuilder.Configurations.Add(new DetallePedidoMap());
             modelBuilder.Configurations.Add(new MesaMap());
             modelBuilder.Configurations.Add(new PedidoMap());
             modelBuilder.Configurations.Add(new PlatoMap());
             modelBuilder.Configurations.Add(new TipoCambioMap());
             modelBuilder.Configurations.Add(new TrabajadorMap());
             modelBuilder.Configurations.Add(new TurnoMap());
             modelBuilder.Configurations.Add(new VentaMap());
         
        }
    }
}
